groupName = $groupName; $this->packageName = $packageName; $this->version = $version; $this->setFilePath = $setFilePath; Assert::regex($this->packageName, self::PACKAGE_REGEX); Assert::fileExists($setFilePath); } public function getGroupName() : string { return $this->groupName; } public function getSetFilePath() : string { return $this->setFilePath; } /** * @param InstalledPackage[] $installedPackages */ public function matchInstalledPackages(array $installedPackages) : bool { foreach ($installedPackages as $installedPackage) { if ($installedPackage->getName() !== $this->packageName) { continue; } return \version_compare($installedPackage->getVersion(), $this->version) !== -1; } return \false; } public function getName() : string { return $this->packageName . ' ' . $this->version; } }